package top.nana7mi.headshot;

import net.minecraft.init.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;
import top.nana7mi.headshot.event.HeadShotEventHandler;
import top.nana7mi.headshot.event.RenderEventHandler;

@Mod(modid = Headshot.MOD_ID, name = Headshot.NAME, version = Headshot.VERSION)
public class Headshot
{
    public static final String MOD_ID = "headshot";
    public static final String NAME = "Headshot";
    public static final String VERSION = "0.0.1";

    private static Logger logger;


    public static HeadShotEventHandler eventHandler;
    public static RenderEventHandler renderHandler;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        logger = event.getModLog();

        eventHandler = new HeadShotEventHandler();
        MinecraftForge.EVENT_BUS.register(eventHandler);

        renderHandler = new RenderEventHandler();
        MinecraftForge.EVENT_BUS.register(renderHandler);

        logger.info("register event");
    }

    @EventHandler
    public void init(FMLInitializationEvent event)
    {
        // some example code
        logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
    }
}
